<?php
require_once("Includes/connection.php");
require_once("Includes/functions.php");
session_start();
if(isset($_SESSION['username'])){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script src="JS/scriptaculous/lib/prototype.js" type="text/javascript"></script>
<script src="JS/scriptaculous/src/scriptaculous.js" type="text/javascript"></script>
<title>Q&A </title>
<style type="text/css">
.tag_cloud { padding: 3px; text-decoration: none; color: #81d601;}
.tag_cloud:hover { color: #ffffff; background: #69da03; }
.tag_cloud:active { color: #ffffff; background: #ACFC65; }
</style>
</head>
<body>
	<table id="header">
    <tr><td></td>
    <td colspan="2" style="width:1000px; text-align:center;">
    	<table><tr><td width="180">
    	<img src="images/logo_qanda.gif" height="80"/>
		</td><td>
        <h1 style="height:auto;">ACM RUM Q&A </h1>
		</td></tr></table>
    </td>
    <td></td></tr>
    <tr><td style="border-bottom:1px solid black;"></td><td style="width:180px;"></td><td style="border-bottom:1px solid black; width:813px;"></td><td style="border-bottom:1px solid black;"></td></tr>
    </table>
    <table id="container">
        <tr>
        <td style="border-left:1px solid black; border-right:1px solid black; width:176px; height:30px; padding-top:10px; padding-left:5px; background-color:#FC0;">
        <a href="home.php">Home</a>
        </td><td rowspan="6" style="border-right:1px solid #CCC; border-bottom:1px solid #CCC;  padding-top:15px;">
            <table id="main_content">
            <tr>
            <td>            				
				<?php
                echo '<h2><span style="text-decoration:underline;">'.$_GET['short_name'].'</span> Tag Cloud</h2>';
				$cloud_tag=get_tag_cloud();
				foreach($cloud_tag as $tags){
					echo $tags.'<br/>';
				}
				?>
			</td>
			</tr>
            </table>
        </td></tr>
        <tr><td style="border-left:1px solid black; border-right:1px solid black; width:176px; height:30px; padding-left:5px; background-color:#FC0;">
        <a href="create_poll.php">Create Poll</a>
        </td></tr>
        <tr><td style="border:1px solid black; border-right:none; background-color:#FFF; width:176px; height:30px; padding-left:5px;">
        <a href="view_polls.php">View Polls</a>
        </td></tr>
        <tr><td style="border-left:1px solid black; border-right:1px solid black; width:176px; height:30px; padding-left:5px; background-color:#FC0;">
        <a href="manage_accounts.php">Manage Accounts</a>
        </td></tr>
        <tr><td style="border-left:1px solid black; border-right:1px solid black; width:176px; height:30px; padding-left:5px; background-color:#FC0;">
        <a href="index.php">Logout</a>
        </td></tr>
        <tr><td style="border:1px solid black; border-top:none; width:176px; padding-left:5px; background-color:#FC0;">
        </td>
        </tr>
    </table>
</body>
</html>
<?php 
}
else{
	header('Location: index.php');
}
?>
